package cn.dataling.dag.listener;

import cn.dataling.dag.pojo.DagWorkflowNode;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.List;

public class DefaultDagNodeStateListener implements DagNodeStateListener {

    private static final Logger LOGGER = LoggerFactory.getLogger(DefaultDagNodeStateListener.class);

    @Override
    public void onStateChange(DagWorkflowNode dagWorkflowNode) {
        LOGGER.info("{} {} {}", dagWorkflowNode.getId(), dagWorkflowNode.getName(), dagWorkflowNode.getState().name());
    }

    @Override
    public void onStateChange(List<DagWorkflowNode> dagWorkflowNodes) {
        LOGGER.info("{} 个节点状态发生变化", dagWorkflowNodes.size());
    }
}
